import axios from 'axios';

var AlbumService = {};
// process.env.API_HOST
AlbumService.search = function(pageIndex, pageSize){
  let data = {
    pageIndex: pageIndex,
    pageSize: pageSize
  }
  return axios.post(process.env.API_HOST + "home/album/searchAlbum", data)
    .then(function(res){
      return res;
    })
    .catch(function(error){
      throw(error);
    })
};

AlbumService.addPicture = function(data){
  return axios.post(process.env.API_HOST + "home/album/addFile", data)
    .then(function(res){
      return res;
    })
    .catch(function(error){
      throw(error);
    })
};

export default AlbumService;
